package com.lanou3g.hw0510;

import org.apache.commons.io.IOUtils;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * Created by dllo on 18/5/10.
 */
@WebServlet(name = "AServlet", urlPatterns = "/a")
public class AServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        response.addHeader("content-Type", "text/html;charset=utf-8");

        response.setHeader("Refresh", "5;url=/down");

        response.getWriter().println("<a href=\"/down\">" + "5s后开始下载 如果没有成功点击此处</a>");


    }
}
